import Vue from 'vue'
import VueRouter from 'vue-router'

import login from './pages/login'
import register from './pages/register.vue'

import home from './pages/home/home'
import announcement from './pages/home/announcement'
import announcements from './pages/home/announcements'

import dishes from './pages/dish-exchange/dishes'
import dishDetail from './pages/dish-exchange/dish-detail'
import releaseDish from './pages/dish-exchange/release-dish'
import message from './pages/message'
import chat from './pages/chat'

import purchases from './pages/group-purchase/purchases'
import purchasesDetail from './pages/group-purchase/purchase-detail'
import releasePurchase from './pages/group-purchase/release-purchase'

import user from './pages/user/user'
import userInfo from './pages/user/user-info'
import myCollect from './pages/user/my-collect'
import myRelease from './pages/user/my-release'
import myGroupPurchase from './pages/user/my-group-purchase'

import commodity from './pages/flea-market/commodity'
import commodity_details from './pages/flea-market/commodity-details'
import release_commodity from './pages/flea-market/release-commodity'
import post_news from './pages/community-pictorial/post-news'
import news_details from './pages/community-pictorial/news-details'
import services from './pages/peripheral-services/services'
import services_details from './pages/peripheral-services/services-details'
import release_services from './pages/peripheral-services/release-services'

Vue.use(VueRouter)

const routes=[
    {
        path:'/login',
        component:login,
        meta:{
            navShow:false
        }
    },
    {
        path:'/',
        redirect:'/login',
    },
    {
        path:'/home',
        component:home,
        meta:{
            navShow:true
        }
    },
    {
        path:'/home/:announcementID/announcement',
        component:announcement,
        meta:{
            navShow:false
        }
    },
    {
        path:'/home/announcements',
        component:announcements,
        meta:{
            navShow:false
        }
    },
    {
        path:'/user',
        component:user,
        meta:{
            navShow:true
        }
    },
    {
        path:'/dishes',
        component:dishes,
        meta:{
            navShow:true
        }
    },
    {
        path:'/dishes/:dishID/dish-detail',
        component:dishDetail,
        meta:{
            navShow:false
        }
    },
    {
        path:'/dishes/release-dish',
        component:releaseDish,
        meta:{
            navShow:false
        }
    },
    {
        path:'/:contact/chat',
        component:chat,
        meta:{
            navShow:false
        }
    },
    {
        path:'/message',
        component:message,
        meta:{
            navShow:true
        }
    },
    {
        path:'/purchases',
        component:purchases,
        meta:{
            navShow:true
        }
    },
    {
        path:'/purchases/:purchaseID/purchase-detail',
        component:purchasesDetail,
        meta:{
            navShow:false
        }
    },
    {
        path:'/purchases/release-purchase',
        component:releasePurchase,
        meta:{
            navShow:false
        }
    },
    {
        path:'/user/user-info',
        component:userInfo,
        meta:{
            navShow:false
        }
    },
    {
        path:'/user/my-collect',
        component:myCollect,
        meta:{
            navShow:true
        }
    },
    {
        path:'/user/my-release',
        component:myRelease,
        meta:{
            navShow:true
        }
    },
    {
        path:'/user/my-group-purchase',
        component:myGroupPurchase,
        meta:{
            navShow:true
        }
    },
    {
        path:'/flea-market',
        component:commodity,
        meta:{
            navShow:true
        }
    },

    {
        path:'/flea-market/:commodityID/commodity-details',
        component:commodity_details,
        meta:{
            navShow:false
        }
    },
    {
        path:'/flea-market/release-commodity',
        component:release_commodity,
        meta:{
            navShow:false
        }
    },
    {
        path:'/community-pictorial',
        component:post_news,
        meta:{
            navShow:true
        }
    },
    {
        path:'/community-pictorial/:newsID/news-details',
        component:news_details,
        meta:{
            navShow:true
        }
    },
    {
        path:'/peripheral-services',
        component:services,
        meta:{
            navShow:true
        }
    },
    {
        path:'/peripheral-services/:serviceID/services-details',
        component:services_details,
        meta:{
            navShow:false
        }
    },
    {
        path:'/peripheral-services/release-services',
        component:release_services,
        meta:{
            navShow:false
        }
    },
    {
        path:'/register',
        component:register,
        meta:{
            navShow:false
        }
    }


]

var router=new VueRouter({
    routes
})

export default router